using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using mesoBoard.Data.Repositories;
using mesoBoard.Data;
using mesoBoard.Web.Models;
using mesoBoard.Web.Core;
using mesoBoard.Web;
using System.IO;
using mesoBoard.Services;

namespace mesoBoard.Web.Areas.Admin.Controllers
{
    public partial class AdminController : mesoBoardAdminController
    {
        public AdminController()
        {
        }

        public ActionResult Index()
        {
            ViewData["NewestRegistrations"] = Repositories.Users.GetAllUsers();
            ViewData["ReportedPosts"] = Repositories.ReportedPosts.GetReportedPosts();
            SetCrumb("Summary");
            return View();
        }

        public ActionResult ReportedPosts()
        {
            SetCrumb("Reported Posts");
            IEnumerable<ReportedPost> ReportedPosts = Repositories.ReportedPosts.GetReportedPosts();
            return View(ReportedPosts);
        }

        public ActionResult MarkAsSafe(int ReportedPostID)
        {
            Repositories.ReportedPosts.DeleteReportedPost(ReportedPostID);
            SetSuccess("Post marked as safe");
            return RedirectToAction("ReportedPosts");
        }

        public ActionResult Confirm(string YesRedirect, string NoRedirect)
        {
            ViewData["Redirects"] = new string[] { YesRedirect, NoRedirect };
            return View();
        }
    }
}